package site.zhangzhuo.learn_springboot.runner;

import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

//如果没加任何手段注册bean，不会被spring注入
//这里用@Configuration来注入
@Configuration
public class beans {
    @Bean
    public Runner2 schedulerRunner() {
        return new Runner2();
    }
}

@Order(1)
class Runner2 implements CommandLineRunner {
    @Override
    public void run(String... args) throws Exception {
        //System.out.println("class Runner2 implements CommandLineRunner......");
    }
}